/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import java.util.Scanner;

/**
 *
 * @author ddpc
 */
public class email {
    Scanner teclado;
    String a;

    email() {
        teclado = new Scanner(System.in);
        System.out.println("Introduce direccion email");
        a = teclado.nextLine();
    }

    public void buscarArroba() {
        if (a.contains("@")) {
            System.out.println("La @ esta en la posicion: " + a.indexOf("@") + ".");
        } else {
            System.out.println("no es un email, no contine @.");
        }
    }

    public static void main(String[] args) {
        email x = new email();
        x.buscarArroba();
    }
}
